package com.chen.learnknowledge.controller;


import com.chen.learnknowledge.entity.Staff;
import com.chen.learnknowledge.service.StaffService;
import com.chen.learnknowledge.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/staff")
public class StaffController {


    @Autowired
    StaffService staffService;
    /**
     * 员工部门表联查
     */
    @GetMapping("/getStaffAndDept")
    public R getStaffAndDept(@RequestParam("id") Integer id){
        Staff staffAndDept = staffService.getStaffAndDept(id);
        return R.ok().put("staffAndDept",staffAndDept);
    }


}
